package com.gitee.wsl.mathematics.geometry.d2.rect.ext

import com.gitee.wsl.mathematics.geometry.d2.base.MarginAble
import com.gitee.wsl.mathematics.geometry.d2.rect.RectangleShape2d


fun<N:Number> RectangleShape2d<N, *,*>.without(padding: MarginAble<N>) = create(
    left + padding.left,
    top + padding.top,
    right - padding.right,
    bottom - padding.bottom
)

fun<N:Number> RectangleShape2d<N, *,*>.with(margin: MarginAble<N>) = create(
    left - margin.left,
    top - margin.top,
    right + margin.right,
    bottom + margin.bottom
)

fun<N:Number> RectangleShape2d<N, *,*>.expanded(border: MarginAble<N>) =
    create(
        left - border.left,
        top - border.top,
        right + border.right,
        bottom + border.bottom
    )